home *** CD-ROM | disk | FTP | other *** search
/ Nejlepší hry / Nejlepsi hry.iso / hry / sea of chaos / sea_install.msi / _15C39AAA7726369D39812BD40F01CF6A / _5E940E3707C34725B3B87CFD1EFD0DD5 < prev    next >
Encoding:
Text File  |  2004-11-20  |  832 b   |  42 lines

  1. //simple shader to clip any pixels with a Z coordinate below the water plane
  2. //doesn't do any shading, just texture sampling
  3. //must be used with clipZ.psh
  4. //Luke Lenhart
  5. //(C)2004-2005 Digipen Institute of Technology
  6.  
  7. //world,view,projection transform
  8. float4x4 matWorldViewProj;
  9. float4x4 matWorld;
  10.  
  11. //shader input
  12. struct VS_INPUT
  13. {
  14.     float4 Pos : POSITION;
  15.     float2 Tex0 : TEXCOORD0;
  16. };
  17.  
  18. //shader output
  19. struct VS_OUTPUT
  20. {
  21.     float4 Pos0 : POSITION;
  22.     float4 Pos1 : TEXCOORD1;
  23.     float2 Tex0 : TEXCOORD0;
  24. };
  25.  
  26. //shader code
  27. VS_OUTPUT VShader(VS_INPUT In)
  28. {
  29.     VS_OUTPUT Out;
  30.     
  31.     //copy tex coord
  32.     Out.Tex0=In.Tex0;
  33.     
  34.     //calc transformed position
  35.     Out.Pos0=mul(matWorldViewProj,In.Pos);
  36.     Out.Pos1=mul(matWorld,In.Pos);
  37.         
  38.         
  39.     //spit out the results
  40.     return Out;
  41. }
  42.